package com.ironone.mediaplayerdemo;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.widget.SlidingPaneLayout;
import android.support.v4.widget.SlidingPaneLayout.PanelSlideListener;
import android.view.KeyEvent;
import android.view.View;
import com.ironone.mediaplayerdemo3.R;

public class SecondActivity extends FragmentActivity {

	SlidingPaneLayout mPane;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.second_activity);

		mPane = (SlidingPaneLayout) findViewById(R.id.pane);		 
		mPane.setSliderFadeColor(100 * 0x1000000);
		mPane.setParallaxDistance(100);
		mPane.setShadowResource(R.drawable.line);

		//Animation animation = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.slide_middle_to_left);
		//mPane.setAnimation(animation);
		//mPane.setCameraDistance(200f);


		mPane.setPanelSlideListener(new PanelSlideListener() {

			@Override
			public void onPanelSlide(View arg0, float arg1) {
			}

			@Override
			public void onPanelOpened(View arg0) {
			}

			@Override
			public void onPanelClosed(View arg0) {
			}
		});

		//mPane.setSoundEffectsEnabled(false);
		//mPane.openPane();
		getSupportFragmentManager().beginTransaction().add(R.id.pane1, new Frag1(), "pane1").commit();
		getSupportFragmentManager().beginTransaction().add(R.id.pane2, new Frag2(), "pane2").commit();
	}


	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_BACK) {
			//preventing default implementation previous to android.os.Build.VERSION_CODES.ECLAIR
			return true;
		}
		return super.onKeyDown(keyCode, event);    
	}

}